package com.oss.validation;

import org.springframework.util.StringUtils;

import com.oss.model.Site;

/**
 * @author xueqiang.mi
 * @since 2010-8-15
 */
public class BlogValidator {

	public static boolean validate(Site obj) {
		if (!StringUtils.hasLength(obj.getName())) {
			return false;
		}
		if (!StringUtils.hasLength(obj.getUrl())) {
			return false;
		}
		if (obj.getUrl().length() < 10
				|| !(obj.getUrl().startsWith("http://") || obj.getUrl()
						.startsWith("https://"))) {
			return false;
		}
		return true;
	}

}
